

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_AngleToRadian_RT : RT_Node
    {
        public RT_SingleValuePort Angle_RT;

        public RT_SingleValuePort Radian_RT;

        public Node_AngleToRadian_RT(Node_AngleToRadian sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            Angle_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Angle, this);

            Radian_RT = new RT_SingleValuePort(EPortIOType.Output, sourceData.Radian, this);
            Radian_RT.OnGetValue = GetRadian;
        }

        public AValue GetRadian(DAG_Executor executor)
        {
            float angle = Angle_RT.GetValue(executor).ToScalar().Item2;
            float radian = angle * 0.01745329f;
            Radian_RT.SourceValue.SetScalar(radian);
            return Radian_RT.SourceValue;
        }
    }
}